package com.linln.modules.system.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.linln.common.utils.StatusUtil;
import com.linln.component.excel.annotation.Excel;
import com.linln.component.excel.enums.ExcelType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author 小懒虫
 * @date 2018/8/14
 */
@Data
@Entity
@Table(name = "pcs_verify_log")
@ToString(exclude = {"dept", "roles"})
@EqualsAndHashCode(exclude = {"dept", "roles"})
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update pcs_verify_log" + StatusUtil.SLICE_DELETE)
@Where(clause = StatusUtil.NOT_DELETE)
@Excel("审核记录")
public class VerifyLog implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Excel(value = "ID", type = ExcelType.EXPORT)
    private Long id;

    @CreatedDate
    @Excel("创建时间")
    private Date createTime;

    @LastModifiedDate
    @Excel("更新时间")
    private Date updateTime;

    @JsonIgnore
    private Long createUser;

    @JsonIgnore
    private Long updateUser;

    @Excel("审核类型 1 护理权限审核 2 合同模板审核 3服务项目")
    private Integer type; // 新增字段

    @Excel("引用被审核实体ID")
    private Long cid; // 新增字段

    @Excel("审核状态 -1 待提交 0 待审核 1 审核通过 2 审核驳回")
    private Integer verifyStatus; // 新增字段

    @Excel("备注/驳回理由")
    private String remark; // 新增字段
}